<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>$课堂练习$</title>
</head>
<body>
<script>
    function isPrimeNumber(num) {
        for (var i = 2; i < num; i++) {
            if (num % i == 0) {
                return false;
            }
        }
        return true;
    }

    var result = isPrimeNumber(parseInt(prompt("请输入数字")));
    if (result) {
        console.log("这个数字是质数");
    } else {
        console.log("这个数字不是质数");
    }
</script>
</body>
</html>